﻿<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:controls="clr-namespace:nRoute.Samples.OfficerXcel.Controls;assembly=OfficerXcel.Infrastructure"
             xmlns:n="http://nRoute/schemas/2010/xaml" 
             x:Class="nRoute.Samples.OfficerXcel.App"
             mc:Ignorable="d">

    <Application.ApplicationLifetimeObjects>
        <n:nRouteApplicationService>
            
            <n:XamlSiteMapProvider>

                <n:SiteMap>
                        
                    <!-- SITEMAP -->
                    <n:SiteMap.RootNode>

                        <n:NavigationNode>

                            <n:NavigationNode Title="Info"
                                                        Url="Dialogs/InfoDialog">
                                <n:ControllerActionNode Title="Save"
                                                                Key="SaveWorksheet"
                                                                IsEnabled="false"
                                                                Url="Worksheet/Active/SaveWorksheet"
                                                                IconPath="/OfficerXcel.Content;component/Icons/Save.png" />
                                <n:ControllerActionNode Title="Save As"
                                                                Key="SaveWorksheetAs"
                                                                IsEnabled="false"
                                                                Url="Worksheet/Active/SaveWorksheet"
                                                                IconPath="/OfficerXcel.Content;component/Icons/SaveAs.png" />
                                <n:ControllerActionNode Title="Open"
                                                                Key="OpenWorksheet"
                                                                Url="Worksheet/Active/OpenWorksheet"
                                                                IconPath="/OfficerXcel.Content;component/Icons/Open.png" />
                                <n:ControllerActionNode Title="Close"
                                                                Key="CloseWorksheet"
                                                                IsEnabled="false"
                                                                Url="Worksheet/Active/CloseWorksheet"
                                                                IconPath="/OfficerXcel.Content;component/Icons/Close.png" />
                            </n:NavigationNode>


                            <n:NavigationNode Title="New"
                                                        Url="Dialogs/NewDialog/" />

                            <n:NavigationNode Title="Print"
                                                        Url="Dialogs/PrintDialog/" />

                            <n:NavigationNode Title="Share"
                                                        Url="Dialogs/ShareDialog/" />

                            <n:NavigationNode Title="Office®"
                                                        Url="Dialogs/OptionsDialog">
                                <n:ControllerActionNode Title="Options"
                                                                Url="Shell/Options/Settings"
                                                                IconPath="/OfficerXcel.Content;component/Icons/Options.png" />
                                <n:ControllerActionNode Title="Exit"
                                                                Url="Shell/Options/Exit"
                                                                IconPath="/OfficerXcel.Content;component/Icons/Exit.png" />
                            </n:NavigationNode>

                        </n:NavigationNode>

                    </n:SiteMap.RootNode>
                </n:SiteMap>

            </n:XamlSiteMapProvider>
                
        </n:nRouteApplicationService>
    </Application.ApplicationLifetimeObjects>

    <Application.Resources>

        <ResourceDictionary>

            <!-- Resources scoped at the Application level should be defined here. -->
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources/LinksListResources.xaml" />
                <ResourceDictionary Source="Resources/ContainerResources.xaml" />
                <ResourceDictionary Source="Resources/DocumentTemplatesListResources.xaml" />
                <ResourceDictionary Source="Resources/PrintListResources.xaml" />
                <ResourceDictionary Source="Resources/OptionsListResources.xaml" />
                <ResourceDictionary Source="Resources/ViewServiceControlsResourceDictionary.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <!-- SIDE BAR LINKs SELECTED BRUSH -->
            <LinearGradientBrush x:Key="SelectedLinkBkgBrush"
                                 EndPoint="0.5,1"
                                 StartPoint="0.5,0">
                <GradientStop Color="#FF6DD852"
                              Offset="1" />
                <GradientStop Color="#FF34A515"
                              Offset="0.162" />
                <GradientStop Color="#FF4ADB2F"
                              Offset="0.856" />
                <GradientStop Color="#FF5BC527"
                              Offset="0.667" />
                <GradientStop Color="#FF4B9B3C"
                              Offset="0.08" />
            </LinearGradientBrush>

            <!-- SHELL BKG -->
            <RadialGradientBrush x:Key="ShellBackgroundBrush"
                                 RadiusX="0.653"
                                 RadiusY="0.671">
                <RadialGradientBrush.RelativeTransform>
                    <TransformGroup>
                        <ScaleTransform CenterX="0.5"
                                        CenterY="0.5" />
                        <SkewTransform CenterX="0.5"
                                       CenterY="0.5" />
                        <RotateTransform Angle="47.352"
                                         CenterX="0.5"
                                         CenterY="0.5" />
                        <TranslateTransform />
                    </TransformGroup>
                </RadialGradientBrush.RelativeTransform>
                <GradientStop Color="#FF111723"
                              Offset="1" />
                <GradientStop Color="#FF384864"
                              Offset="0" />
            </RadialGradientBrush>

            <!-- OFFICER LOGO, PATH DATA -->
            <Style x:Key="OfficeLogoStyle"
                   TargetType="Path">
                <Setter Property="Data"
                        Value="M19.207031,15.644062 L19.207031,16.884296 C19.207031,17.235859 19.329102,17.532084 19.573242,17.772968 C19.817383,18.013853 20.108723,18.134296 20.447266,18.134296 C20.785809,18.134296 21.078777,18.012226 21.326172,17.768085 C21.573566,17.523945 21.697266,17.229349 21.697266,16.884296 C21.697266,16.545755 21.573566,16.254414 21.326172,16.010273 C21.078777,15.766132 20.785809,15.644062 20.447266,15.644062 z M11.775391,15.644062 C11.43685,15.644062 11.145508,15.767759 10.901367,16.015156 C10.657227,16.262552 10.535156,16.552265 10.535156,16.884296 C10.535156,17.229349 10.657227,17.523945 10.901367,17.768085 C11.145508,18.012226 11.43685,18.134296 11.775391,18.134296 C12.120443,18.134296 12.415039,18.010599 12.65918,17.763203 C12.90332,17.515806 13.025391,17.222837 13.025391,16.884296 L13.025391,15.644062 z M14.871094,11.31789 L14.871094,13.798359 L17.361328,13.798359 L17.361328,11.31789 z M20.447266,6.9819527 C20.108723,6.9819527 19.817383,7.104023 19.573242,7.3481636 C19.329102,7.5923042 19.207031,7.8836451 19.207031,8.222187 L19.207031,9.472187 L20.447266,9.472187 C20.792316,9.472187 21.086914,9.3484888 21.331055,9.1010933 C21.575195,8.8536978 21.697266,8.560729 21.697266,8.222187 C21.697266,7.8901558 21.573566,7.6004419 21.326172,7.3530464 C21.078777,7.1056509 20.785809,6.9819527 20.447266,6.9819527 z M11.775391,6.9819527 C11.449869,6.9819527 11.161783,7.1023951 10.911133,7.3432808 C10.660481,7.5841665 10.535156,7.8771353 10.535156,8.222187 C10.535156,8.5672388 10.657227,8.8618355 10.901367,9.1059761 C11.145508,9.3501167 11.43685,9.472187 11.775391,9.472187 L13.025391,9.472187 L13.025391,8.222187 C13.025391,7.8901558 12.900064,7.6004419 12.649414,7.3530464 C12.398764,7.1056509 12.107422,6.9819527 11.775391,6.9819527 z M11.775391,5.1362495 C12.621744,5.1362495 13.349283,5.4389839 13.958008,6.0444527 C14.566732,6.6499214 14.871094,7.3758326 14.871094,8.222187 L14.871094,9.472187 L17.361328,9.472187 L17.361328,8.222187 C17.361328,7.3758326 17.665691,6.6499214 18.274414,6.0444527 C18.883137,5.4389839 19.607422,5.1362495 20.447266,5.1362495 C21.293621,5.1362495 22.02116,5.4389839 22.629883,6.0444527 C23.238607,6.6499214 23.542969,7.3758326 23.542969,8.222187 C23.542969,9.0685415 23.240234,9.7960806 22.634766,10.404804 C22.029297,11.013528 21.300129,11.31789 20.447266,11.31789 L19.207031,11.31789 L19.207031,13.798359 L20.447266,13.798359 C21.300129,13.798359 22.029297,14.104349 22.634766,14.716328 C23.240234,15.328306 23.542969,16.050962 23.542969,16.884296 C23.542969,17.73065 23.240234,18.458189 22.634766,19.066914 C22.029297,19.675638 21.300129,19.98 20.447266,19.98 C19.60091,19.98 18.875,19.678892 18.269531,19.076679 C17.664063,18.474466 17.361328,17.746927 17.361328,16.894062 L17.361328,15.644062 L14.871094,15.644062 L14.871094,16.894062 C14.871094,17.727396 14.568359,18.450052 13.962891,19.062031 C13.357422,19.674009 12.628256,19.98 11.775391,19.98 C10.942058,19.98 10.219401,19.678892 9.6074219,19.076679 C8.9954424,18.474466 8.6894531,17.743671 8.6894531,16.884296 C8.6894531,16.037943 8.9938154,15.312031 9.6025391,14.706562 C10.211263,14.101093 10.935547,13.798359 11.775391,13.798359 L13.025391,13.798359 L13.025391,11.31789 L11.775391,11.31789 C10.929036,11.31789 10.203125,11.015156 9.5976563,10.409687 C8.9921875,9.8042183 8.6894531,9.0750513 8.6894531,8.222187 C8.6894531,7.3758326 8.9938154,6.6499214 9.6025391,6.0444527 C10.211263,5.4389839 10.935547,5.1362495 11.775391,5.1362495 z" />
            </Style>

            <!-- BACK BUTTON RELATED BRUSHES -->
            <LinearGradientBrush x:Key="BackButtonPrimaryBrush"
                                 EndPoint="0.5,1"
                                 StartPoint="0.5,0">
                <GradientStop Color="#FF1E3986"
                              Offset="0.526" />
                <GradientStop Color="#FF4D6EBD"
                              Offset="0.448" />
                <GradientStop Color="#FF556CBC"
                              Offset="1" />
                <GradientStop Color="#FF344D9C"
                              Offset="0.698" />
                <GradientStop Color="#FF5782D1"
                              Offset="0" />
            </LinearGradientBrush>
            <RadialGradientBrush x:Key="BackButtonSecondaryBrush"
                                 RadiusX="0.581"
                                 RadiusY="-1.602">
                <GradientStop Color="#00000000"
                              Offset="0.422" />
                <GradientStop Color="#7C000000"
                              Offset="1" />
            </RadialGradientBrush>
            <LinearGradientBrush x:Key="BackButtonOpacityBrush"
                                 EndPoint="1.019,0.479"
                                 StartPoint="-0.011,0.493">
                <GradientStop Color="#FF000000"
                              Offset="0.522" />
                <GradientStop Color="#00FFFFFF"
                              Offset="0.987" />
            </LinearGradientBrush>

            <!-- DIALOG BUTTON, with an page icon build in -->
            <Style x:Key="DialogButtonTemplate"
                   TargetType="Button">
                <Setter Property="Background"
                        Value="#FF1F3B53" />
                <Setter Property="Foreground"
                        Value="#FF000000" />
                <Setter Property="Padding"
                        Value="3" />
                <Setter Property="BorderThickness"
                        Value="1" />
                <Setter Property="BorderBrush">
                    <Setter.Value>
                        <LinearGradientBrush EndPoint="0.5,1"
                                             StartPoint="0.5,0">
                            <GradientStop Color="#FFA3AEB9"
                                          Offset="0" />
                            <GradientStop Color="#FF8399A9"
                                          Offset="0.375" />
                            <GradientStop Color="#FF718597"
                                          Offset="0.375" />
                            <GradientStop Color="#FF617584"
                                          Offset="1" />
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Grid Cursor="Hand"
                                  Width="80"
                                  Height="80">
                                <vsm:VisualStateManager.VisualStateGroups>
                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                        <vsm:VisualState x:Name="Normal">
                                            <Storyboard d:ShouldSerialize="False" />
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="MouseOver">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                               Duration="00:00:00.0010000"
                                                                               Storyboard.TargetName="Background"
                                                                               Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00"
                                                                          Value="0.967" />
                                                </DoubleAnimationUsingKeyFrames>
                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                              Duration="00:00:00.0010000"
                                                                              Storyboard.TargetName="Background"
                                                                              Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                    <EasingColorKeyFrame KeyTime="00:00:00"
                                                                         Value="#FFD6D6D6" />
                                                </ColorAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                               Duration="00:00:00.0010000"
                                                                               Storyboard.TargetName="Background"
                                                                               Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00"
                                                                          Value="0.394" />
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Pressed">
                                            <Storyboard>
                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                              Duration="00:00:00.0010000"
                                                                              Storyboard.TargetName="Background"
                                                                              Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                    <EasingColorKeyFrame KeyTime="00:00:00"
                                                                         Value="#FFC8CACC" />
                                                </ColorAnimationUsingKeyFrames>
                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                              Duration="00:00:00.0010000"
                                                                              Storyboard.TargetName="Background"
                                                                              Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                    <EasingColorKeyFrame KeyTime="00:00:00"
                                                                         Value="#FF7C8288" />
                                                </ColorAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                               Duration="00:00:00.0010000"
                                                                               Storyboard.TargetName="Background"
                                                                               Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00"
                                                                          Value="0.943" />
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                               Duration="00:00:00.0010000"
                                                                               Storyboard.TargetName="Background"
                                                                               Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00"
                                                                          Value="0.191" />
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                               Duration="00:00:00.0010000"
                                                                               Storyboard.TargetName="Background"
                                                                               Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00"
                                                                          Value="0.785" />
                                                </DoubleAnimationUsingKeyFrames>
                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                              Duration="00:00:00.0010000"
                                                                              Storyboard.TargetName="Background"
                                                                              Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                    <EasingColorKeyFrame KeyTime="00:00:00"
                                                                         Value="#FF7A7A7A" />
                                                </ColorAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                               Duration="00:00:00.0010000"
                                                                               Storyboard.TargetName="Background"
                                                                               Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00"
                                                                          Value="0.309" />
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement"
                                                                               Storyboard.TargetProperty="Opacity">
                                                    <SplineDoubleKeyFrame KeyTime="0"
                                                                          Value=".55" />
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                    </vsm:VisualStateGroup>
                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                        <vsm:VisualState x:Name="Focused">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement"
                                                                               Storyboard.TargetProperty="Opacity">
                                                    <SplineDoubleKeyFrame KeyTime="0"
                                                                          Value="1" />
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Unfocused" />
                                    </vsm:VisualStateGroup>
                                </vsm:VisualStateManager.VisualStateGroups>
                                <Border x:Name="Background"
                                        BorderThickness="{TemplateBinding BorderThickness}"
                                        CornerRadius="3">
                                    <Border.BorderBrush>
                                        <LinearGradientBrush EndPoint="0.5,1"
                                                             StartPoint="0.5,0">
                                            <GradientStop Color="#FFDEDEDE" />
                                            <GradientStop Color="#FFACB1B5"
                                                          Offset="0.963" />
                                        </LinearGradientBrush>
                                    </Border.BorderBrush>
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,1"
                                                             StartPoint="0.5,0">
                                            <GradientStop Color="#FFEEEFF1"
                                                          Offset="0.951" />
                                            <GradientStop Color="#FFFFFFFF"
                                                          Offset="0.033" />
                                        </LinearGradientBrush>
                                    </Border.Background>
                                </Border>
                                <ContentPresenter x:Name="contentPresenter"
                                                  Content="{TemplateBinding Content}"
                                                  ContentTemplate="{TemplateBinding ContentTemplate}"
                                                  HorizontalAlignment="Center"
                                                  VerticalAlignment="Bottom"
                                                  Margin="0,0,0,8" />
                                <Rectangle x:Name="DisabledVisualElement"
                                           Fill="#FFFFFFFF"
                                           RadiusX="3"
                                           RadiusY="3"
                                           IsHitTestVisible="false"
                                           Opacity="0" />
                                <Rectangle x:Name="FocusVisualElement"
                                           StrokeThickness="0.5"
                                           RadiusX="2"
                                           RadiusY="2"
                                           Margin="3,3,3,3"
                                           IsHitTestVisible="false"
                                           Opacity="0"
                                           Stroke="#FF868686"
                                           StrokeDashArray="5" />
                                <Path Fill="#FFFFFFFF"
                                      Stretch="Fill"
                                      Stroke="#FF868686"
                                      StrokeThickness="0.5"
                                      Margin="24.75,11,25.75,29.917"
                                      UseLayoutRounding="False"
                                      Data="M22.333334,48 L22.333334,9.5 L44.916477,9.4169998 L51.333088,16.250334 L51.250088,48 z" />
                                <Path Fill="#FFFFFFFF"
                                      Stretch="Fill"
                                      Stroke="#FF868686"
                                      StrokeThickness="0.5"
                                      Height="7.208"
                                      HorizontalAlignment="Right"
                                      Margin="0,11.167,26,0"
                                      VerticalAlignment="Top"
                                      Width="6.75"
                                      UseLayoutRounding="False"
                                      Data="M47.500046,11.417004 L47.625038,18.125731 L53.749672,18.084381" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <!-- DIALOG IMAGE BUTTON, with a settable image -->
            <Style x:Key="DialogImageButtonTemplate"
                   TargetType="controls:ImageButton">
                <Setter Property="Background"
                        Value="#FF1F3B53" />
                <Setter Property="Foreground"
                        Value="#FF000000" />
                <Setter Property="Padding"
                        Value="3" />
                <Setter Property="BorderThickness"
                        Value="1" />
                <Setter Property="BorderBrush">
                    <Setter.Value>
                        <LinearGradientBrush EndPoint="0.5,1"
                                             StartPoint="0.5,0">
                            <GradientStop Color="#FFA3AEB9"
                                          Offset="0" />
                            <GradientStop Color="#FF8399A9"
                                          Offset="0.375" />
                            <GradientStop Color="#FF718597"
                                          Offset="0.375" />
                            <GradientStop Color="#FF617584"
                                          Offset="1" />
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="controls:ImageButton">
                            <Grid Cursor="Hand"
                                  Width="80"
                                  Height="65">
                                <vsm:VisualStateManager.VisualStateGroups>
                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                        <vsm:VisualState x:Name="Normal">
                                            <Storyboard d:ShouldSerialize="False" />
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="MouseOver">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                               Duration="00:00:00.0010000"
                                                                               Storyboard.TargetName="Background"
                                                                               Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00"
                                                                          Value="0.967" />
                                                </DoubleAnimationUsingKeyFrames>
                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                              Duration="00:00:00.0010000"
                                                                              Storyboard.TargetName="Background"
                                                                              Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                    <EasingColorKeyFrame KeyTime="00:00:00"
                                                                         Value="#FFD6D6D6" />
                                                </ColorAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                               Duration="00:00:00.0010000"
                                                                               Storyboard.TargetName="Background"
                                                                               Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00"
                                                                          Value="0.394" />
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Pressed">
                                            <Storyboard>
                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                              Duration="00:00:00.0010000"
                                                                              Storyboard.TargetName="Background"
                                                                              Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                    <EasingColorKeyFrame KeyTime="00:00:00"
                                                                         Value="#FFC8CACC" />
                                                </ColorAnimationUsingKeyFrames>
                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                              Duration="00:00:00.0010000"
                                                                              Storyboard.TargetName="Background"
                                                                              Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                    <EasingColorKeyFrame KeyTime="00:00:00"
                                                                         Value="#FF7C8288" />
                                                </ColorAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                               Duration="00:00:00.0010000"
                                                                               Storyboard.TargetName="Background"
                                                                               Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00"
                                                                          Value="0.943" />
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                               Duration="00:00:00.0010000"
                                                                               Storyboard.TargetName="Background"
                                                                               Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00"
                                                                          Value="0.191" />
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                               Duration="00:00:00.0010000"
                                                                               Storyboard.TargetName="Background"
                                                                               Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00"
                                                                          Value="0.785" />
                                                </DoubleAnimationUsingKeyFrames>
                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                              Duration="00:00:00.0010000"
                                                                              Storyboard.TargetName="Background"
                                                                              Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                    <EasingColorKeyFrame KeyTime="00:00:00"
                                                                         Value="#FF7A7A7A" />
                                                </ColorAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                                               Duration="00:00:00.0010000"
                                                                               Storyboard.TargetName="Background"
                                                                               Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                    <EasingDoubleKeyFrame KeyTime="00:00:00"
                                                                          Value="0.309" />
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement"
                                                                               Storyboard.TargetProperty="Opacity">
                                                    <SplineDoubleKeyFrame KeyTime="0"
                                                                          Value=".55" />
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                    </vsm:VisualStateGroup>
                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                        <vsm:VisualState x:Name="Focused">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualElement"
                                                                               Storyboard.TargetProperty="Opacity">
                                                    <SplineDoubleKeyFrame KeyTime="0"
                                                                          Value="1" />
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Unfocused" />
                                    </vsm:VisualStateGroup>
                                </vsm:VisualStateManager.VisualStateGroups>
                                <Border x:Name="Background"
                                        BorderThickness="{TemplateBinding BorderThickness}"
                                        CornerRadius="3">
                                    <Border.BorderBrush>
                                        <LinearGradientBrush EndPoint="0.5,1"
                                                             StartPoint="0.5,0">
                                            <GradientStop Color="#FFDEDEDE" />
                                            <GradientStop Color="#FFACB1B5"
                                                          Offset="0.963" />
                                        </LinearGradientBrush>
                                    </Border.BorderBrush>
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,1"
                                                             StartPoint="0.5,0">
                                            <GradientStop Color="#FFEEEFF1"
                                                          Offset="0.951" />
                                            <GradientStop Color="#FFFFFFFF"
                                                          Offset="0.033" />
                                        </LinearGradientBrush>
                                    </Border.Background>
                                </Border>
                                <ContentPresenter x:Name="contentPresenter"
                                                  Content="{TemplateBinding Content}"
                                                  ContentTemplate="{TemplateBinding ContentTemplate}"
                                                  HorizontalAlignment="Center"
                                                  VerticalAlignment="Bottom"
                                                  Margin="0,0,0,8" />
                                <Rectangle x:Name="FocusVisualElement"
                                           StrokeThickness="0.5"
                                           RadiusX="2"
                                           RadiusY="2"
                                           Margin="3,3,3,3"
                                           IsHitTestVisible="false"
                                           Opacity="0"
                                           Stroke="#FF868686"
                                           StrokeDashArray="5" />
                                <Image Source="{TemplateBinding ImageSource}"
                                       Width="32"
                                       Height="32"
                                       VerticalAlignment="Top"
                                       Margin="0,6,0,0" />
                                <Rectangle x:Name="DisabledVisualElement"
                                           Fill="#FFFFFFFF"
                                           RadiusX="3"
                                           RadiusY="3"
                                           IsHitTestVisible="false"
                                           Opacity="0" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

        </ResourceDictionary>
    </Application.Resources>

</Application>
